feat(sdk-playground): interactive SDK chat playground - #1437
Conversation
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | b01d2b6 | Sep 01 2026, 06:19 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | b01d2b6 | Commit Preview URL Branch Preview URL |
Sep 01 2026, 06:20 AM |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
| }, | ||
| { status: 400 }, | ||
| ) | ||
| } |
There was a problem hiding this comment.
Context API needs OpenAI key
Medium Severity
The context routes use resolveApiKeys, which returns null unless both Supermemory and OpenAI keys are present. Loading container context only calls Supermemory, and the context panel only validates the Supermemory key, so a dashboard with just a Supermemory key still gets a 400 from /api/context.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
| } else { | ||
| delete process.env.OPENAI_API_KEY | ||
| } | ||
| } |
There was a problem hiding this comment.
Shared env keys race
Medium Severity
Chat handlers temporarily overwrite global SUPERMEMORY_API_KEY and OPENAI_API_KEY on the shared Node process and Python process. Overlapping requests with different dashboard keys can read or write the wrong credentials mid-flight.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
| skipMemoryOnError: middlewareConfig.skipMemoryOnError, | ||
| }, | ||
| keys.supermemoryApiKey, | ||
| ) |
There was a problem hiding this comment.
Debug shows post-chat profile
Low Severity
Middleware memory debug is built by fetching profile after the model response (and after auto-save). The “Context injected into prompt” preview can include memories written in that same turn, not what middleware actually injected.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
There was a problem hiding this comment.
Overview: Adds a new SDK playground app with Next.js frontend and Python FastAPI backend for interactively testing Supermemory SDK integrations across TypeScript and Python.
Issues found: None — this looks good to ship.
I reviewed ~4000 lines of new code across 26 files including:
- Next.js API routes (
/api/chat,/api/context) - Python FastAPI server with multiple SDK integration handlers
- Frontend components (chat UI, API keys panel, context panel)
- Core business logic (
chat-handlers.ts,context-api.ts,api-keys.ts)
Design choices appropriate for a dev playground:
- API keys in localStorage with clear user messaging
- Permissive CORS on Python server (
allow_origins=["*"]) - Temporary env var manipulation for SDK compatibility
Code quality observations:
- Good error handling throughout both TypeScript and Python
- Proper API key resolution chain (user input → env vars)
- Clean SDK abstraction via registry pattern
- Tool loop limits prevent runaway execution (8 steps max)
Score: 9/10
Minor deduction for documentation mismatch (README says port 8791, env example says 8792) — not a blocker.
78269ff to
69def1a
Compare
93f92cd to
4e04a0d
Compare
There was a problem hiding this comment.
Overview: Adds an SDK playground app with Next.js frontend and Python FastAPI backend for interactively testing Supermemory SDK integrations across TypeScript and Python.
Issues found: None — this looks good to ship.
I reviewed ~5000 lines of new code across 29 files including:
- Next.js API routes (
/api/chat,/api/context) with proper request validation - Python FastAPI server with multiple SDK integration handlers
- Frontend components (chat UI, API keys panel, context panel)
- Core business logic (
chat-handlers.ts,context-api.ts,request-validation.ts) - CI workflow additions for Python validation
Previous review issues addressed:
The latest commit (4e04a0d) fixes the two substantive issues from the earlier Cursor Bugbot review:
- ✅ Context API no longer requires OpenAI key (now uses
resolveSupermemoryApiKey) - ✅ API keys are passed directly to SDK clients, eliminating the env-var race condition
Security measures in place:
TrustedHostMiddlewarerestricts Python server to localhost onlyassertTrustedBrowserRequestvalidates request origin and rejects cross-site requestsmayUseEnvironmentKeysrestricts env-key usage to trusted hosts (localhost, sdk.dev.supermemory.ai)- Comprehensive input validation with length limits, pattern matching, and body size checks
SecretStrused for API keys in Python Pydantic models- API keys stored in
sessionStorage(notlocalStorage), scoped to tab lifetime
Design choices appropriate for a dev playground:
- Permissive CORS on Python server (localhost-only anyway)
- 8-step tool loop limit prevents runaway execution
- Proper timeout handling with best-effort debug info collection
Score: 9/10
Minor deduction for documentation mismatch (README mentions port 8791 in one place, env example says 8792) — not a blocker.
Merge activity
|
8a78b11 to
e1c3122
Compare
0804596 to
d51641c
Compare
d51641c to
05c4fb6
Compare
## Summary - Add `apps/sdk-playground` — chat UI to test TS/Python SDK integrations - Context panel with document memories, API keys in dashboard, tools reference tab - Python FastAPI server on port 8792; portless entry in `portless.json` Stacked on #1436 ## Test plan - [ ] `cd apps/sdk-playground && bun run check-types` - [ ] `bun run dev` with Supermemory + OpenAI keys in UI - [ ] Switch SDKs and verify chat + context panel Made with [Cursor](https://cursor.com)
e1c3122 to
ff2d0cf
Compare
## Summary - Add `apps/sdk-playground` — chat UI to test TS/Python SDK integrations - Context panel with document memories, API keys in dashboard, tools reference tab - Python FastAPI server on port 8792; portless entry in `portless.json` Stacked on #1436 ## Test plan - [ ] `cd apps/sdk-playground && bun run check-types` - [ ] `bun run dev` with Supermemory + OpenAI keys in UI - [ ] Switch SDKs and verify chat + context panel Made with [Cursor](https://cursor.com)
05c4fb6 to
7974498
Compare
ff2d0cf to
b01d2b6
Compare
The base branch was changed.



Summary
apps/sdk-playground— chat UI to test TS/Python SDK integrationsportless.jsonStacked on #1436
Test plan
cd apps/sdk-playground && bun run check-typesbun run devwith Supermemory + OpenAI keys in UIMade with Cursor